package comparators;


import java.util.Comparator;
import java.math.BigDecimal;
import brewery.Beer;

public class BeerBrixComparator implements Comparator<Beer>{
	public int compare(Beer beer1, Beer beer2){
		BigDecimal beer1Brix = beer1.getBrixDegrees();
		BigDecimal beer2Brix = beer2.getBrixDegrees();
		
		if(beer1Brix.compareTo(beer2Brix)>0){
			return 1;
		} else if (beer1Brix.compareTo(beer2Brix)<0){
			return -1;
		} else {
			return 0;
		}
	}
}